<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Console.Haskeline.Command.Undo</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html"><span class="hs-identifier">System.Console.Haskeline.Command</span></a></span><span>
</span><span id="line-4"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html"><span class="hs-identifier">System.Console.Haskeline.LineState</span></a></span><span>
</span><span id="line-5"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html"><span class="hs-identifier">System.Console.Haskeline.Monads</span></a></span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-keyword">data</span><span> </span><span id="Undo"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-var">Undo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Undo"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-var">Undo</span></a></span></span><span> </span><span class="hs-special">{</span><span id="pastUndo"><span class="annot"><span class="annottext">Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var hs-var">pastUndo</span></a></span></span><span class="hs-special">,</span><span> </span><span id="futureRedo"><span class="annot"><span class="annottext">Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var hs-var">futureRedo</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">type</span><span> </span><span id="UndoT"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#UndoT"><span class="hs-identifier hs-var">UndoT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StateT</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span id="local-6989586621679093148"><span id="local-6989586621679093149"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#runUndoT"><span class="hs-identifier hs-type">runUndoT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093149"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#UndoT"><span class="hs-identifier hs-type">UndoT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093149"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093148"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679093149"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093148"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-14"></span><span id="runUndoT"><span class="annot"><span class="annottext">runUndoT :: forall (m :: * -&gt; *) a. Monad m =&gt; UndoT m a -&gt; m a
</span><a href="System.Console.Haskeline.Command.Undo.html#runUndoT"><span class="hs-identifier hs-var hs-var">runUndoT</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Undo -&gt; StateT Undo m a -&gt; m a
forall (m :: * -&gt; *) s a. Monad m =&gt; s -&gt; StateT s m a -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#evalStateT%27"><span class="hs-identifier hs-var">evalStateT'</span></a></span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="System.Console.Haskeline.Command.Undo.html#initialUndo"><span class="hs-identifier hs-var">initialUndo</span></a></span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#initialUndo"><span class="hs-identifier hs-type">initialUndo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span>
</span><span id="line-17"></span><span id="initialUndo"><span class="annot"><span class="annottext">initialUndo :: Undo
</span><a href="System.Console.Haskeline.Command.Undo.html#initialUndo"><span class="hs-identifier hs-var hs-var">initialUndo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Undo :: [InsertMode] -&gt; [InsertMode] -&gt; Undo
</span><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">pastUndo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var">pastUndo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">futureRedo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var">futureRedo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span id="local-6989586621679093139"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#saveToUndo"><span class="hs-identifier hs-type">saveToUndo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093139"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679093139"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span></span><span>
</span><span id="line-21"></span><span id="saveToUndo"><span class="annot"><span class="annottext">saveToUndo :: forall s. Save s =&gt; s -&gt; Undo -&gt; Undo
</span><a href="System.Console.Haskeline.Command.Undo.html#saveToUndo"><span class="hs-identifier hs-var hs-var">saveToUndo</span></a></span></span><span> </span><span id="local-6989586621679093078"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093078"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679093077"><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093077"><span class="hs-identifier hs-var">undo</span></a></span></span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679093075"><span class="hs-identifier hs-var">isSame</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Undo :: [InsertMode] -&gt; [InsertMode] -&gt; Undo
</span><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">pastUndo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var">pastUndo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093074"><span class="hs-identifier hs-var">toSave</span></a></span><span class="annot"><span class="annottext">InsertMode -&gt; [InsertMode] -&gt; [InsertMode]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var hs-var">pastUndo</span></a></span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093077"><span class="hs-identifier hs-var">undo</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">futureRedo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var">futureRedo</span></a></span><span class="hs-glyph">=</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093077"><span class="hs-identifier hs-var">undo</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-25"></span><span>    </span><span id="local-6989586621679093074"><span class="annot"><span class="annottext">toSave :: InsertMode
</span><a href="#local-6989586621679093074"><span class="hs-identifier hs-var hs-var">toSave</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; InsertMode
forall s. Save s =&gt; s -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#save"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093078"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-26"></span><span>    </span><span id="local-6989586621679093075"><span class="annot"><span class="annottext">isSame :: Bool
</span><a href="#local-6989586621679093075"><span class="hs-identifier hs-var hs-var">isSame</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var hs-var">pastUndo</span></a></span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093077"><span class="hs-identifier hs-var">undo</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-27"></span><span>                </span><span id="local-6989586621679093069"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093069"><span class="hs-identifier hs-var">u</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[InsertMode]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093069"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093074"><span class="hs-identifier hs-var">toSave</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-28"></span><span>                </span><span class="annot"><span class="annottext">[InsertMode]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span id="local-6989586621679093134"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#undoPast"><span class="hs-identifier hs-type">undoPast</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#redoFuture"><span class="hs-identifier hs-type">redoFuture</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093134"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679093134"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679093134"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-31"></span><span id="undoPast"><span class="annot"><span class="annottext">undoPast :: forall s. Save s =&gt; s -&gt; Undo -&gt; (s, Undo)
</span><a href="System.Console.Haskeline.Command.Undo.html#undoPast"><span class="hs-identifier hs-var hs-var">undoPast</span></a></span></span><span> </span><span id="local-6989586621679093063"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093063"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span id="local-6989586621679093062"><span class="annot"><span class="annottext">u :: Undo
</span><a href="#local-6989586621679093062"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">pastUndo :: Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var">pastUndo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093063"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093062"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#undoPast"><span class="hs-identifier hs-var">undoPast</span></a></span><span> </span><span id="local-6989586621679093061"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093061"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span id="local-6989586621679093060"><span class="annot"><span class="annottext">u :: Undo
</span><a href="#local-6989586621679093060"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">pastUndo :: Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var">pastUndo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679093059"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093059"><span class="hs-identifier hs-var">pastLS</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679093058"><span class="annot"><span class="annottext">[InsertMode]
</span><a href="#local-6989586621679093058"><span class="hs-identifier hs-var">lss</span></a></span></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-33"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; s
forall s. Save s =&gt; InsertMode -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#restore"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093059"><span class="hs-identifier hs-var">pastLS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093060"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">pastUndo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var">pastUndo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InsertMode]
</span><a href="#local-6989586621679093058"><span class="hs-identifier hs-var">lss</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">futureRedo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var">futureRedo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; InsertMode
forall s. Save s =&gt; s -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#save"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093061"><span class="hs-identifier hs-var">ls</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; [InsertMode] -&gt; [InsertMode]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var hs-var">futureRedo</span></a></span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093060"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span id="redoFuture"><span class="annot"><span class="annottext">redoFuture :: forall s. Save s =&gt; s -&gt; Undo -&gt; (s, Undo)
</span><a href="System.Console.Haskeline.Command.Undo.html#redoFuture"><span class="hs-identifier hs-var hs-var">redoFuture</span></a></span></span><span> </span><span id="local-6989586621679093053"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093053"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span id="local-6989586621679093052"><span class="annot"><span class="annottext">u :: Undo
</span><a href="#local-6989586621679093052"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">futureRedo :: Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var">futureRedo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093053"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093052"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#redoFuture"><span class="hs-identifier hs-var">redoFuture</span></a></span><span> </span><span id="local-6989586621679093051"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093051"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span id="local-6989586621679093050"><span class="annot"><span class="annottext">u :: Undo
</span><a href="#local-6989586621679093050"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">futureRedo :: Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var">futureRedo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679093049"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093049"><span class="hs-identifier hs-var">futureLS</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679093048"><span class="annot"><span class="annottext">[InsertMode]
</span><a href="#local-6989586621679093048"><span class="hs-identifier hs-var">lss</span></a></span></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-37"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; s
forall s. Save s =&gt; InsertMode -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#restore"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679093049"><span class="hs-identifier hs-var">futureLS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093050"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">futureRedo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#futureRedo"><span class="hs-identifier hs-var">futureRedo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InsertMode]
</span><a href="#local-6989586621679093048"><span class="hs-identifier hs-var">lss</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pastUndo :: [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var">pastUndo</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">s -&gt; InsertMode
forall s. Save s =&gt; s -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#save"><span class="hs-identifier hs-var">save</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093051"><span class="hs-identifier hs-var">ls</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; [InsertMode] -&gt; [InsertMode]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Undo -&gt; [InsertMode]
</span><a href="System.Console.Haskeline.Command.Undo.html#pastUndo"><span class="hs-identifier hs-var hs-var">pastUndo</span></a></span><span> </span><span class="annot"><span class="annottext">Undo
</span><a href="#local-6989586621679093050"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span id="local-6989586621679093130"><span id="local-6989586621679093131"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#saveForUndo"><span class="hs-identifier hs-type">saveForUndo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093131"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadState"><span class="hs-identifier hs-type">MonadState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093130"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span>                </span><span class="hs-glyph">=&gt;</span><span>&#160;</span><span class="annot"><a href="System.Console.Haskeline.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093130"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093131"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093131"><span class="hs-identifier hs-type">s</span></a></span></span></span><span>
</span><span id="line-43"></span><span id="saveForUndo"><span class="annot"><span class="annottext">saveForUndo :: forall s (m :: * -&gt; *).
(Save s, MonadState Undo m) =&gt;
Command m s s
</span><a href="System.Console.Haskeline.Command.Undo.html#saveForUndo"><span class="hs-identifier hs-var hs-var">saveForUndo</span></a></span></span><span> </span><span id="local-6989586621679093034"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093034"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><span class="annottext">(Undo -&gt; Undo) -&gt; CmdM m ()
forall s (m :: * -&gt; *). MonadState s m =&gt; (s -&gt; s) -&gt; m ()
</span><a href="System.Console.Haskeline.Monads.html#modify"><span class="hs-identifier hs-var">modify</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s -&gt; Undo -&gt; Undo
forall s. Save s =&gt; s -&gt; Undo -&gt; Undo
</span><a href="System.Console.Haskeline.Command.Undo.html#saveToUndo"><span class="hs-identifier hs-var">saveToUndo</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093034"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><span class="annottext">s -&gt; CmdM m s
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679093034"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span id="local-6989586621679093112"><span id="local-6989586621679093113"><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#commandUndo"><span class="hs-identifier hs-type">commandUndo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#commandRedo"><span class="hs-identifier hs-type">commandRedo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadState"><span class="hs-identifier hs-type">MonadState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093113"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Save"><span class="hs-identifier hs-type">Save</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093112"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093113"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093112"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679093112"><span class="hs-identifier hs-type">s</span></a></span></span></span><span>
</span><span id="line-48"></span><span id="commandUndo"><span class="annot"><span class="annottext">commandUndo :: forall (m :: * -&gt; *) s.
(MonadState Undo m, Save s) =&gt;
Command m s s
</span><a href="System.Console.Haskeline.Command.Undo.html#commandUndo"><span class="hs-identifier hs-var hs-var">commandUndo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (Either Effect s)) -&gt; Command m s s
forall s (m :: * -&gt; *).
(LineState s, Monad m) =&gt;
(s -&gt; m (Either Effect s)) -&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#simpleCommand"><span class="hs-identifier hs-var">simpleCommand</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m (Either Effect s)) -&gt; Command m s s)
-&gt; (s -&gt; m (Either Effect s)) -&gt; Command m s s
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(s -&gt; Either Effect s) -&gt; m s -&gt; m (Either Effect s)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; Either Effect s
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(m s -&gt; m (Either Effect s))
-&gt; (s -&gt; m s) -&gt; s -&gt; m (Either Effect s)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Undo -&gt; (s, Undo)) -&gt; m s
forall s (m :: * -&gt; *) a. MonadState s m =&gt; (s -&gt; (a, s)) -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#update"><span class="hs-identifier hs-var">update</span></a></span><span> </span><span class="annot"><span class="annottext">((Undo -&gt; (s, Undo)) -&gt; m s)
-&gt; (s -&gt; Undo -&gt; (s, Undo)) -&gt; s -&gt; m s
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; Undo -&gt; (s, Undo)
forall s. Save s =&gt; s -&gt; Undo -&gt; (s, Undo)
</span><a href="System.Console.Haskeline.Command.Undo.html#undoPast"><span class="hs-identifier hs-var">undoPast</span></a></span><span>
</span><span id="line-49"></span><span id="commandRedo"><span class="annot"><span class="annottext">commandRedo :: forall (m :: * -&gt; *) s.
(MonadState Undo m, Save s) =&gt;
Command m s s
</span><a href="System.Console.Haskeline.Command.Undo.html#commandRedo"><span class="hs-identifier hs-var hs-var">commandRedo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (Either Effect s)) -&gt; Command m s s
forall s (m :: * -&gt; *).
(LineState s, Monad m) =&gt;
(s -&gt; m (Either Effect s)) -&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#simpleCommand"><span class="hs-identifier hs-var">simpleCommand</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m (Either Effect s)) -&gt; Command m s s)
-&gt; (s -&gt; m (Either Effect s)) -&gt; Command m s s
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(s -&gt; Either Effect s) -&gt; m s -&gt; m (Either Effect s)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; Either Effect s
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(m s -&gt; m (Either Effect s))
-&gt; (s -&gt; m s) -&gt; s -&gt; m (Either Effect s)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Undo -&gt; (s, Undo)) -&gt; m s
forall s (m :: * -&gt; *) a. MonadState s m =&gt; (s -&gt; (a, s)) -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#update"><span class="hs-identifier hs-var">update</span></a></span><span> </span><span class="annot"><span class="annottext">((Undo -&gt; (s, Undo)) -&gt; m s)
-&gt; (s -&gt; Undo -&gt; (s, Undo)) -&gt; s -&gt; m s
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; Undo -&gt; (s, Undo)
forall s. Save s =&gt; s -&gt; Undo -&gt; (s, Undo)
</span><a href="System.Console.Haskeline.Command.Undo.html#redoFuture"><span class="hs-identifier hs-var">redoFuture</span></a></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span></pre></body></html>